package main

import (
	"go-rpc/service"
	"log"
	"net"
	"net/http"
	"net/rpc"
)

func main() {

	service := new(service.ServiceA)
	rpc.Register(service)
	rpc.HandleHTTP() // 基于 HTTP协议
	l, e := net.Listen("tcp", "localhost:9091")
	if e != nil {
		log.Fatal("listen error:", e)
	}

	http.Serve(l, nil)

}
